# -*- coding: utf-8 -*-
"""
Created on Mon Sep 17 22:32:03 2018

@author: cheny
"""

#% 占位格式化
s1 = "%s, 您好，我是张三。"
#print (s1 % "李四")
s2 = "大家好，我叫 %s, 我今年 %d 岁了。"
print (s2)
print (s2 %("Amy", 19))

s3 = "大家好，{1} 岁的我叫 {0}, 今年 {1} 岁".format("Tony", 18)
print (s3)

num1 = 9 / 4  #结果为2.25，python3.X 是带小数运算的，python2.x 是和C语言一致，结果为2
num2 = 9 % 4  #取余，结果为1，和C语言一致
num3 = 9 //4  #取整，结果为2
num4 = 3 ** 3 #幂运算符，即3的3次方，结果为27
print (num1,num2,num3,num4)

#成员运算符
l = [1,2,3,4,5]
a = 7
b = 4
c = a in l
d = b in l
print (c,d)

a =  10
b = 10
print (a is b)
a = "hello world"
b = "hello world"
print (a is b)